package com.elegant.code.service.impl;

import com.elegant.code.aop.cache.Cache;
import com.elegant.code.aop.redission.RedissonLock;
import com.elegant.code.aop.zk.ZkLock;
import com.elegant.code.dao.UserMapper;
import com.elegant.code.domain.User;
import com.elegant.code.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;
    @Override

    /*@RedissonLock(name = "user")
    @ZkLock*/
    @Cache(keyPrefix = "user")
    public User getUser(Integer id) {
        return userMapper.findOne(id);
    }
}
